﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace taobaoSpider
{
    public static class ReadIniFile
    {
        [System.Runtime.InteropServices.DllImport("kernel32")]
        private static extern int GetPrivateProfileString(string section,string key, string def, StringBuilder retVal,int size, string filePath);
        /// <summary> 
        /// 读出INI文件 
        /// </summary> 
        /// <param name="Section">项目名称(如 [TypeName] )</param> 
        /// <param name="Key">键</param> 
        public static string IniReadValue(string Section, string Key)
        {
            StringBuilder temp = new StringBuilder(500);
            int i = GetPrivateProfileString(Section, Key, "", temp, 500, System.Windows.Forms.Application.StartupPath + "//HtmlNodeXPath.ini");
            return temp.ToString();
        }
    }
}
